package me.lwn.auth.security.oauth2.server.authorization.authentication;

import org.springframework.lang.Nullable;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.core.AuthorizationGrantType;

import java.util.Map;
import java.util.Set;

public class OAuth2PasswordAuthenticationToken extends RequestAuthenticationToken {

    private final AuthorizationGrantType authorizationGrantType;

    public OAuth2PasswordAuthenticationToken(AuthorizationGrantType authorizationGrantType,
                                             Authentication clientPrincipal,
                                             @Nullable Set<String> scopes,
                                             @Nullable Map<String, Object> additionalParameters) {
        super(clientPrincipal, scopes, additionalParameters);
        this.authorizationGrantType = authorizationGrantType;
    }

    public AuthorizationGrantType getGrantType() {
        return this.authorizationGrantType;
    }
}
